package de.uni_mannheim.informatik.ai.dame_ai.main.application;

import java.io.File;
import java.util.Arrays;

public class GameSettings {
	
	private boolean isReplay=false;
	private boolean isLoadGame=false;
	private boolean finished=false;
	public boolean isFinished() {
		return finished;
	}
	public void setFinished(boolean finished) {
		this.finished = finished;
	}
	private File filePath;
	public boolean isLoadGame() {
		return isLoadGame;
	}
	public void setLoadGame(boolean isLoadGame) {
		this.isLoadGame = isLoadGame;
	}
	public File getFilePath() {
		return filePath;
	}
	public void setFilePath(File filePath) {
		this.filePath = filePath;
	}
	private MainPlayer[] players=null;
	private int language=0;
	public static final int GERMAN = 0;
	public static final int ENGLISH = 1;
	public GameSettings(){
		
	}
	public boolean isReplay() {
		return isReplay;
	}
	public void setReplay(boolean isReplay) {
		this.isReplay = isReplay;
	}
	public MainPlayer[] getPlayers() {
		return players;
	}
	public void setPlayers(MainPlayer[] players) {
		this.players = players;
	}
	public int getLanguage() {
		return language;
	}
	public void setLanguage(int language) {
		this.language = language;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((filePath == null) ? 0 : filePath.hashCode());
		result = prime * result + (finished ? 1231 : 1237);
		result = prime * result + (isLoadGame ? 1231 : 1237);
		result = prime * result + (isReplay ? 1231 : 1237);
		result = prime * result + language;
		result = prime * result + Arrays.hashCode(players);
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		GameSettings other = (GameSettings) obj;
		if (filePath == null) {
			if (other.filePath != null)
				return false;
		} else if (!filePath.equals(other.filePath))
			return false;
		if (finished != other.finished)
			return false;
		if (isLoadGame != other.isLoadGame)
			return false;
		if (isReplay != other.isReplay)
			return false;
		if (language != other.language)
			return false;
		if (!Arrays.equals(players, other.players))
			return false;
		return true;
	}
	
}
